The EBMON protocol for AMD29K

Contents|Index|Previous|Next
The EBMON protocol for AMD29K

AMD distributes a 29K development board meant to fit in a PC, together with a DOS-hosted monitor program called EBMON. “EB29K” is a shorthand term for this development system. The following documentation discusses the “EB29K” development.

- Communications setup
- EB29K cross-debugging
- Remote log

To use GDB from a Unix system to run programs on the EB29K board, you must first connect a serial cable between the PC (which hosts the EB29K board) and a serial port on the Unix system.

In the following discussions, we assume you’ve hooked the cable between the PC’s ‘COM1’ port and ‘/dev/ttya’ on the Unix system.

Communications setup

The next step is to set up the PC’s port, by using something like the following in DOS on the PC:

C:\> MODE com1:9600,n,8,1,none

This example—run on an MS DOS 4.0 system—sets the PC port to 9600 bps, no parity, eight data bits, one stop bit, and no “retry” action; you must match the communications parameters when establishing the Unix end of the connection as well.

To give control of the PC to the Unix side of the serial line, at the C:\> prompt, type: CTTY com1.

(Later, if you wish to return control to the DOS console, you can use the command CTTY con—but you must send it over the device that had control, in the example, over the ‘COM1’ serial line). From the Unix host, use a communications program such as tip or cu to communicate with the PC; for example, cu -s 9600 -l /dev/ttya.

The cu options shown specify, respectively, the linespeed and the serial port to use. If you use tip instead, your command line may look something like: tip -9600 /dev/ttya.

Your system may require a different name where we show /dev/ttya as the argument to tip. The communications parameters, including which port to use, are associated with the tip argument in the “remote” descriptions file—normally the system table, /etc/remote.

Using the tip or cu connection, change the DOS working directory to the directory containing a copy of your 29K program, then start the PC program, EBMON (an EB29K control program supplied with your board by AMD).

You should see an initial display from EBMON similar to the one that follows, ending with the EBMON prompt, ‘#’—

C:\> G:

G:\> CD \usr\joe\work29k
G:\USR\JOE\WORK29K> EBMON Am29000 PC Coprocessor Board Monitor, version 3.0-18 Copyright 1990 Advanced Micro Devices, Inc. Written by Gibbons and Associates, Inc.

Enter ’?’ or ’H’ for help

PC Coprocessor Type = EB29K
I/O Base = 0x208
Memory Base = 0xd0000
Data Memory Size = 2048KB
Available I-RAM Range = 0x8000 to 0x1fffff
Available D-RAM Range = 0x80002000 to 0x801fffff

PageSize = 0x400
Register Stack Size = 0x800
Memory Stack Size = 0x1800

CPU PRL = 0x3
Am29027 Available = No
Byte Write Available = Yes

# ˜.

Then exit the cu or tip program (in the example by using `˜.` at the EBMON prompt, #). EBMON keeps running, ready for GDB to take over.

For this example, we’ve assumed what is probably the most convenient way to make sure the same 29K program is on both the PC and the Unix system: a PC/NFS connection that establishes “drive G:”on the PC as a file system on the Unix host. If you do not have PC/NFS or something similar connecting the two systems, you must arrange some other way—perhaps floppy-disk transfer—of getting the 29K program from the Unix system to the PC; GDB does not download it over the serial line.

EB29K cross-debugging

Finally, cd to the directory containing an image of your 29K program on the Unix system, and start GDB—specifying as argument the name of your 29K program, as in the following example.

cd /usr/joe/work29k
gdb myfoo

Now, use the target command, target amd-eb /dev/ttya 9600 MYFOO

In this example, we’ve assumed your program is in a file called ‘myfoo’.

Note:
The filename given as the last argument to target amd-eb should be the name of the program as it appears to DOS. In our example this is simply MYFOO, but in general it can include a DOS path, and, depending on your transfer mechanism, may not resemble the name on the Unix side. At this point, you can set any breakpoints you wish; when you are ready to see your program run on the 29K board, use the GDB command, run.

To stop debugging the remote program, use the GDB detach command.

To return control of the PC to its console, use tip or cu once again, after your GDB session has concluded, to attach to EBMON. You can then type the command q to shut down EBMON, returning control to the DOS command-line interpreter. Type CTTY con to return command input to the main DOS console, and type ˜. to leave tip or cu.

Remote log

The target amd-eb command creates a file, ‘eb.log’, in the current working directory, to help debug problems with the connection. ‘eb.log’ records all the output from EBMON, including echoes of the commands sent to it. Running ‘tail -f’ on this file in another window often helps to understand trouble with EBMON, or unexpected events on the PC side of the connection.

Top|Contents|Index|Previous|Next